package demo4_10;

public class Test {
    public static void main(String[] args) {
        Student student1 = new Student("zhangsan", 15);
        Student student2 = new Student("lisi", 12);

        //年龄比较器
        AgeComparator ageComparator = new AgeComparator();
        int ret = ageComparator.compare(student1, student2);
        System.out.println(ret);

        //姓名比较器
        NameComparator nameComparator = new NameComparator();
        int ret1 = nameComparator.compare(student1, student2);
        System.out.println(ret1);
    }
}
